#ifndef __OLED_096_JJ_H__
#define __OLED_096_JJ_H__


//-------------------------------------命令集--------------------------------------
#define SSD1315_ADDRESS_7BIT        (0x3C)      //ssd1315的7bit地址
#define SSD1315_ADDRESS_8BIT        (0x78)      //ssd1315的8bit地址,带读写位，写是0x78读是0x79
#define SSD1315_COMMEND             (0x00)      //后跟指令
#define SSD1315_DATA                (0x40)      //后跟显示数据
#define SSD1315_OFF                 (0xAE)
#define SSD1315_ON                  (0xAF)
#define SSD1315_WIDTH               (128)
#define SSD1315_HEIGHT              (64)
//-------------------------------------命令集--------------------------------------
//--------------------------------------常量---------------------------------------
typedef enum {  //符号大小
    SIZE_6x8 = 8,
    SIZE_8x16 = 16,
    SIZE_12x24 = 24,
    SIZE_16x32 = 32,
    SIZE_24x48 = 48,
    // SIZE_32x64 = 64,     //哈哈，没写
}font_size_t;
typedef enum {  //中文符号大小
    SIZE_CHA_8x8 = 8,
    SIZE_CHA_16x16 = 16,
    SIZE_CHA_24x24 = 24,
}font_size_cha_t;
//--------------------------------------常量---------------------------------------



//--------------------------------------变量---------------------------------------
typedef struct {
    uint8_t pos_x;
    uint8_t pos_y;
}struct_pos;        //光标结构体
//--------------------------------------变量---------------------------------------

//-------------------------------------基础函数--------------------------------------
void I2C_WriteCommand_Multiple(const uint32_t count_command, ...);      //I2C命令连续写入
void I2C_WriteData_Multiple(const uint32_t count_data, ...);            //I2C数据连续写入

int OLED_Init(I2C_HandleTypeDef *hi2c);                                                                                //初始化
int OLED_ALL_ON(void);                                                                              //全显示
int OLED_All_Clear(void);                                                                           //全屏擦除
int OLED_Selected_Clear(uint8_t x, uint8_t end_x, uint8_t page, uint8_t end_page);                  //部分擦除

int OLED_Show_Char(uint8_t x, uint8_t page, uint8_t chr, font_size_t char_height, uint8_t char_turn);   //显示单个字符
int OLED_Show_String(uint8_t x, uint8_t page,const char *str, font_size_t char_height, uint8_t char_turn);  //显示字符串
int OLED_Show_int(uint8_t x, uint8_t y, int num, uint8_t len, font_size_t char_height, uint8_t char_turn);  //显示有符号数字
int OLED_Show_uint(uint8_t x, uint8_t y, uint32_t num, uint8_t len, font_size_t char_height, uint8_t char_turn);    //显示无符号数字
int OLED_Show_float(uint8_t x, uint8_t y, float num, uint8_t len_int, uint8_t len_float, font_size_t char_height, uint8_t char_turn);   //显示有符号浮点数
int OLED_Show_BMP(uint8_t x, uint8_t x_end, uint8_t page, uint8_t page_end, uint8_t *bmp, uint8_t char_turn);                       //显示bmp图像
int OLED_Show_Chinese_Multiple(uint8_t x, uint8_t page, const font_size_cha_t size, const uint8_t Cha[][32], uint8_t char_turn, uint8_t count_Chinese, ...);    //显示多个汉字
//-------------------------------------基础函数--------------------------------------



#endif